import grpc

import safeguardgrpc_pb2_grpc
import safeguardgrpc_pb2

def run():
    channel = grpc.insecure_channel('localhost:50051')
    stub = safeguardgrpc_pb2_grpc.NetworkControllerStub(channel)
    #message = stub.Create(safeguardgrpc_pb2.NetworkRequest(Action="ALLOWED", Hostname="localhost", PID=1, Comm="test", ParentComm="testparent", Addr="/root/", Domain="test", Port="111", Protocol="tcp"))
    #print(message)

    messagelist = stub.List(safeguardgrpc_pb2.NetworkListRequest())
    print(messagelist)

if __name__ == '__main__':
    run()

